/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model.impl;

import com.crossriver.crgis.database.model.Individual_Information;
import com.crossriver.crgis.database.model.Individual_InformationModel;
import com.crossriver.crgis.database.model.Individual_InformationSoap;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * The base model implementation for the Individual_Information service. Represents a row in the &quot;CRGIA_Individual_Information&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.crossriver.crgis.database.model.Individual_InformationModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link Individual_InformationImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a individual_ information model instance should use the {@link com.crossriver.crgis.database.model.Individual_Information} interface instead.
 * </p>
 *
 * @author Wole Adetiba
 * @see Individual_InformationImpl
 * @see com.crossriver.crgis.database.model.Individual_Information
 * @see com.crossriver.crgis.database.model.Individual_InformationModel
 * @generated
 */
public class Individual_InformationModelImpl extends BaseModelImpl<Individual_Information>
	implements Individual_InformationModel {
	public static final String TABLE_NAME = "CRGIA_Individual_Information";
	public static final Object[][] TABLE_COLUMNS = {
			{ "applicationId", new Integer(Types.VARCHAR) },
			{ "userId", new Integer(Types.VARCHAR) },
			{ "title", new Integer(Types.VARCHAR) },
			{ "lastName", new Integer(Types.VARCHAR) },
			{ "firstName", new Integer(Types.VARCHAR) },
			{ "middleName", new Integer(Types.VARCHAR) },
			{ "dateOfBirth", new Integer(Types.TIMESTAMP) },
			{ "occupation", new Integer(Types.VARCHAR) },
			{ "gender", new Integer(Types.VARCHAR) },
			{ "religion", new Integer(Types.VARCHAR) },
			{ "education", new Integer(Types.VARCHAR) },
			{ "nationality", new Integer(Types.VARCHAR) },
			{ "stateOfOrigin", new Integer(Types.VARCHAR) },
			{ "lga", new Integer(Types.VARCHAR) },
			{ "maritalStatus", new Integer(Types.VARCHAR) },
			{ "noOfChildren", new Integer(Types.INTEGER) },
			{ "identificationDoc", new Integer(Types.VARCHAR) },
			{ "identificationDocNo", new Integer(Types.VARCHAR) }
		};
	public static final String TABLE_SQL_CREATE = "create table CRGIA_Individual_Information (applicationId VARCHAR(75) not null primary key,userId VARCHAR(75) null,title VARCHAR(75) null,lastName VARCHAR(75) null,firstName VARCHAR(75) null,middleName VARCHAR(75) null,dateOfBirth DATE null,occupation VARCHAR(75) null,gender VARCHAR(75) null,religion VARCHAR(75) null,education VARCHAR(75) null,nationality VARCHAR(75) null,stateOfOrigin VARCHAR(75) null,lga VARCHAR(75) null,maritalStatus VARCHAR(75) null,noOfChildren INTEGER,identificationDoc VARCHAR(75) null,identificationDocNo VARCHAR(75) null)";
	public static final String TABLE_SQL_DROP = "drop table CRGIA_Individual_Information";
	public static final String ORDER_BY_JPQL = " ORDER BY individual_Information.applicationId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CRGIA_Individual_Information.applicationId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.crossriver.crgis.database.model.Individual_Information"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.crossriver.crgis.database.model.Individual_Information"),
			true);

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static Individual_Information toModel(
		Individual_InformationSoap soapModel) {
		Individual_Information model = new Individual_InformationImpl();

		model.setApplicationId(soapModel.getApplicationId());
		model.setUserId(soapModel.getUserId());
		model.setTitle(soapModel.getTitle());
		model.setLastName(soapModel.getLastName());
		model.setFirstName(soapModel.getFirstName());
		model.setMiddleName(soapModel.getMiddleName());
		model.setDateOfBirth(soapModel.getDateOfBirth());
		model.setOccupation(soapModel.getOccupation());
		model.setGender(soapModel.getGender());
		model.setReligion(soapModel.getReligion());
		model.setEducation(soapModel.getEducation());
		model.setNationality(soapModel.getNationality());
		model.setStateOfOrigin(soapModel.getStateOfOrigin());
		model.setLga(soapModel.getLga());
		model.setMaritalStatus(soapModel.getMaritalStatus());
		model.setNoOfChildren(soapModel.getNoOfChildren());
		model.setIdentificationDoc(soapModel.getIdentificationDoc());
		model.setIdentificationDocNo(soapModel.getIdentificationDocNo());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<Individual_Information> toModels(
		Individual_InformationSoap[] soapModels) {
		List<Individual_Information> models = new ArrayList<Individual_Information>(soapModels.length);

		for (Individual_InformationSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.crossriver.crgis.database.model.Individual_Information"));

	public Individual_InformationModelImpl() {
	}

	public String getPrimaryKey() {
		return _applicationId;
	}

	public void setPrimaryKey(String pk) {
		setApplicationId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _applicationId;
	}

	public String getApplicationId() {
		if (_applicationId == null) {
			return StringPool.BLANK;
		}
		else {
			return _applicationId;
		}
	}

	public void setApplicationId(String applicationId) {
		_applicationId = applicationId;
	}

	public String getUserId() {
		if (_userId == null) {
			return StringPool.BLANK;
		}
		else {
			return _userId;
		}
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public String getTitle() {
		if (_title == null) {
			return StringPool.BLANK;
		}
		else {
			return _title;
		}
	}

	public void setTitle(String title) {
		_title = title;
	}

	public String getLastName() {
		if (_lastName == null) {
			return StringPool.BLANK;
		}
		else {
			return _lastName;
		}
	}

	public void setLastName(String lastName) {
		_lastName = lastName;
	}

	public String getFirstName() {
		if (_firstName == null) {
			return StringPool.BLANK;
		}
		else {
			return _firstName;
		}
	}

	public void setFirstName(String firstName) {
		_firstName = firstName;
	}

	public String getMiddleName() {
		if (_middleName == null) {
			return StringPool.BLANK;
		}
		else {
			return _middleName;
		}
	}

	public void setMiddleName(String middleName) {
		_middleName = middleName;
	}

	public Date getDateOfBirth() {
		return _dateOfBirth;
	}

	public void setDateOfBirth(Date dateOfBirth) {
		_dateOfBirth = dateOfBirth;
	}

	public String getOccupation() {
		if (_occupation == null) {
			return StringPool.BLANK;
		}
		else {
			return _occupation;
		}
	}

	public void setOccupation(String occupation) {
		_occupation = occupation;
	}

	public String getGender() {
		if (_gender == null) {
			return StringPool.BLANK;
		}
		else {
			return _gender;
		}
	}

	public void setGender(String gender) {
		_gender = gender;
	}

	public String getReligion() {
		if (_religion == null) {
			return StringPool.BLANK;
		}
		else {
			return _religion;
		}
	}

	public void setReligion(String religion) {
		_religion = religion;
	}

	public String getEducation() {
		if (_education == null) {
			return StringPool.BLANK;
		}
		else {
			return _education;
		}
	}

	public void setEducation(String education) {
		_education = education;
	}

	public String getNationality() {
		if (_nationality == null) {
			return StringPool.BLANK;
		}
		else {
			return _nationality;
		}
	}

	public void setNationality(String nationality) {
		_nationality = nationality;
	}

	public String getStateOfOrigin() {
		if (_stateOfOrigin == null) {
			return StringPool.BLANK;
		}
		else {
			return _stateOfOrigin;
		}
	}

	public void setStateOfOrigin(String stateOfOrigin) {
		_stateOfOrigin = stateOfOrigin;
	}

	public String getLga() {
		if (_lga == null) {
			return StringPool.BLANK;
		}
		else {
			return _lga;
		}
	}

	public void setLga(String lga) {
		_lga = lga;
	}

	public String getMaritalStatus() {
		if (_maritalStatus == null) {
			return StringPool.BLANK;
		}
		else {
			return _maritalStatus;
		}
	}

	public void setMaritalStatus(String maritalStatus) {
		_maritalStatus = maritalStatus;
	}

	public int getNoOfChildren() {
		return _noOfChildren;
	}

	public void setNoOfChildren(int noOfChildren) {
		_noOfChildren = noOfChildren;
	}

	public String getIdentificationDoc() {
		if (_identificationDoc == null) {
			return StringPool.BLANK;
		}
		else {
			return _identificationDoc;
		}
	}

	public void setIdentificationDoc(String identificationDoc) {
		_identificationDoc = identificationDoc;
	}

	public String getIdentificationDocNo() {
		if (_identificationDocNo == null) {
			return StringPool.BLANK;
		}
		else {
			return _identificationDocNo;
		}
	}

	public void setIdentificationDocNo(String identificationDocNo) {
		_identificationDocNo = identificationDocNo;
	}

	public Individual_Information toEscapedModel() {
		if (isEscapedModel()) {
			return (Individual_Information)this;
		}
		else {
			return (Individual_Information)Proxy.newProxyInstance(Individual_Information.class.getClassLoader(),
				new Class[] { Individual_Information.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		Individual_InformationImpl individual_InformationImpl = new Individual_InformationImpl();

		individual_InformationImpl.setApplicationId(getApplicationId());

		individual_InformationImpl.setUserId(getUserId());

		individual_InformationImpl.setTitle(getTitle());

		individual_InformationImpl.setLastName(getLastName());

		individual_InformationImpl.setFirstName(getFirstName());

		individual_InformationImpl.setMiddleName(getMiddleName());

		individual_InformationImpl.setDateOfBirth(getDateOfBirth());

		individual_InformationImpl.setOccupation(getOccupation());

		individual_InformationImpl.setGender(getGender());

		individual_InformationImpl.setReligion(getReligion());

		individual_InformationImpl.setEducation(getEducation());

		individual_InformationImpl.setNationality(getNationality());

		individual_InformationImpl.setStateOfOrigin(getStateOfOrigin());

		individual_InformationImpl.setLga(getLga());

		individual_InformationImpl.setMaritalStatus(getMaritalStatus());

		individual_InformationImpl.setNoOfChildren(getNoOfChildren());

		individual_InformationImpl.setIdentificationDoc(getIdentificationDoc());

		individual_InformationImpl.setIdentificationDocNo(getIdentificationDocNo());

		return individual_InformationImpl;
	}

	public int compareTo(Individual_Information individual_Information) {
		int value = 0;

		value = getApplicationId()
					.compareTo(individual_Information.getApplicationId());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Individual_Information individual_Information = null;

		try {
			individual_Information = (Individual_Information)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = individual_Information.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(37);

		sb.append("{applicationId=");
		sb.append(getApplicationId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", title=");
		sb.append(getTitle());
		sb.append(", lastName=");
		sb.append(getLastName());
		sb.append(", firstName=");
		sb.append(getFirstName());
		sb.append(", middleName=");
		sb.append(getMiddleName());
		sb.append(", dateOfBirth=");
		sb.append(getDateOfBirth());
		sb.append(", occupation=");
		sb.append(getOccupation());
		sb.append(", gender=");
		sb.append(getGender());
		sb.append(", religion=");
		sb.append(getReligion());
		sb.append(", education=");
		sb.append(getEducation());
		sb.append(", nationality=");
		sb.append(getNationality());
		sb.append(", stateOfOrigin=");
		sb.append(getStateOfOrigin());
		sb.append(", lga=");
		sb.append(getLga());
		sb.append(", maritalStatus=");
		sb.append(getMaritalStatus());
		sb.append(", noOfChildren=");
		sb.append(getNoOfChildren());
		sb.append(", identificationDoc=");
		sb.append(getIdentificationDoc());
		sb.append(", identificationDocNo=");
		sb.append(getIdentificationDocNo());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(58);

		sb.append("<model><model-name>");
		sb.append("com.crossriver.crgis.database.model.Individual_Information");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>applicationId</column-name><column-value><![CDATA[");
		sb.append(getApplicationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>title</column-name><column-value><![CDATA[");
		sb.append(getTitle());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>lastName</column-name><column-value><![CDATA[");
		sb.append(getLastName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>firstName</column-name><column-value><![CDATA[");
		sb.append(getFirstName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>middleName</column-name><column-value><![CDATA[");
		sb.append(getMiddleName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>dateOfBirth</column-name><column-value><![CDATA[");
		sb.append(getDateOfBirth());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>occupation</column-name><column-value><![CDATA[");
		sb.append(getOccupation());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>gender</column-name><column-value><![CDATA[");
		sb.append(getGender());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>religion</column-name><column-value><![CDATA[");
		sb.append(getReligion());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>education</column-name><column-value><![CDATA[");
		sb.append(getEducation());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>nationality</column-name><column-value><![CDATA[");
		sb.append(getNationality());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>stateOfOrigin</column-name><column-value><![CDATA[");
		sb.append(getStateOfOrigin());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>lga</column-name><column-value><![CDATA[");
		sb.append(getLga());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>maritalStatus</column-name><column-value><![CDATA[");
		sb.append(getMaritalStatus());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>noOfChildren</column-name><column-value><![CDATA[");
		sb.append(getNoOfChildren());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>identificationDoc</column-name><column-value><![CDATA[");
		sb.append(getIdentificationDoc());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>identificationDocNo</column-name><column-value><![CDATA[");
		sb.append(getIdentificationDocNo());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _applicationId;
	private String _userId;
	private String _title;
	private String _lastName;
	private String _firstName;
	private String _middleName;
	private Date _dateOfBirth;
	private String _occupation;
	private String _gender;
	private String _religion;
	private String _education;
	private String _nationality;
	private String _stateOfOrigin;
	private String _lga;
	private String _maritalStatus;
	private int _noOfChildren;
	private String _identificationDoc;
	private String _identificationDocNo;
}